<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let a = {name:'张三',age:100}
        let b = {age:10}
        let add = [a,b]
        let s = Symbol('name')
        // 变量重复  后边覆盖前边
        // let c = {name:'李四',name:'张三'}
        // let c = {...a,...b}
        let c = {name:'李四'}
        // 目标对象 ，需要整合的对象
        Object.assign(c,a,b)
        // 添加symbo的属性

        c[s] = "symmmm"
        console.log(c);
        // console.log({name:'张三',age:10});
        // 遍历对象的属性
        for (const item in c) {
            console.log(item);
            console.log(c[item]);
        }
        // 获取对象所有的可遍历的属性
        console.log(Object.keys(c));
        // 获取的所有的值
        console.log(Object.values(c));
        // 只能是symbol的值
        console.log(c[Object.getOwnPropertySymbols(c)[0]]);
        console.log(c[Symbol('name')]);
    </script>
</body>
</html>